<?php $this->load->view('header'); ?>
 <div id="title_background">
	<div class="wrapper"><!-- 900px wrapper -->
		<h1>Profile</h1>
		<!--<span class="title_description">This is crossroads for features. Here you could describe your page or leave it blank.</span>-->
	</div> <!-- 900px wrapper -->
</div>
</div>
<div class="cleaner"></div>
<div id="position_navi"><a href="<?php echo base_url()."users/";?>">Profile</a> / Edit</div>
<div id="content">
<?php $profile = $user[0];?>
	<article>
		<h1>Pengaturan Akun</h1>
		<form class="contact_form" method="POST" enctype="multipart/form-data">
			<input type="hidden" name="id_user" id="id_user" value="<?php if(isset($profile['id_user'])){ echo $profile['id_user']; } ?>" />
			<span>Username: *</span><input type="text" id="user_name" class="unblock" name="username" required="required" autocomplete="off" value="<?php if(isset($profile['username'])){ echo $profile['username']; } ?>"/><span id="usr_verify" class="unblock verify"></span>
			<span>Password: *</span><input type="password" name="password" autocomplete="off" />
		<br>
		<hr style="border: 1px solid #9A9DA9">
		<br>
		<h1>Pengaturan Profile</h1>
			<span>Avatar: *</span><?php if($profile['id_user'] != NULL) { ?>
				<?php $thumb = file_exists(realpath(APPPATH . '../images/user_avatars') . DIRECTORY_SEPARATOR . $profile['foto']) ? BASE_URL() . "images/user_avatars/" . $profile['foto'] : BASE_URL() . "images/user_avatars/default.jpg"; ?>
				<img style="max-height: 150px; max-width: 200px" src="<?php echo $thumb; ?>">
			<?php } ?>
			<input type="file" name="user_avatar">
			<span>Nama Lengkap: *</span><input type="text" name="nama" required="required" autocomplete="off" value="<?php if(isset($profile['nama'])){ echo $profile['nama']; } ?>"/>
			<span>Gender: *</span>
			<select name="jk">
				<option <?php if($profile['jk'] == 'p' ) { echo "selected='selected'"; }?> value="p">Perempuan</option>
				<option <?php if($profile['jk'] == 'l' ) { echo "selected='selected'"; }?> value="l">Laki-laki</option>
			</select>
			<span>Pekerjaan:</span><input type="text" name="pekerjaan" required="required" autocomplete="off" value="<?php if(isset($profile['pekerjaan'])){ echo $profile['pekerjaan']; } ?>"/>
			<span>Alamat:</span><textarea name="alamat" /><?php if(isset($profile['alamat'])){ echo $profile['alamat']; } ?></textarea>
			<span>Telepon:</span><input type="text" name="telepon" value="<?php if(isset($profile['telepon'])){ echo $profile['telepon']; } ?>"/>
			<span>E-mail: </span><input type="text" name="email" required="required" autocomplete="off" value="<?php if(isset($profile['email'])){ echo $profile['email']; } ?>"/>
			<span>Handphone:</span><input type="text" name="hp" value="<?php if(isset($profile['hp'])){ echo $profile['hp']; } ?>"/>
			<span>Status: *</span>
			<select name="status">
				<option <?php if($profile['status'] == 'status' ) { echo "selected='selected'"; }?> value="belum menikah">Belum Menikah</option>
				<option <?php if($profile['status'] == 'status' ) { echo "selected='selected'"; }?> value="menikah">Sudah Menikah</option>
			</select>
			<input type="submit" value="Save" name="profile_submit" id="reg-submit"/>
		</form>
	</article>        

<div class="cleaner"></div>
</div>
<div class="cleaner"></div>
<?php $this->load->view('footer', $footer); ?>